package jgl.android.recyclerviewrefresh.Footer;

import android.content.Context;
import androidx.annotation.ColorInt;
import androidx.annotation.Nullable;
import android.util.AttributeSet;
import android.view.View;
import android.widget.LinearLayout;
import android.widget.TextView;

import jgl.android.loadinglibrary.LoadingIndicatorView;
import jgl.android.recyclerviewrefresh.IBottomView;
import com.android.recyclerviewrefresh.R;

/**
 * Created by Administrator on 2019/9/23.
 */


public class BottomNotDataView extends LinearLayout implements IBottomView {

    private TextView footStateDesc;

    public BottomNotDataView(Context context) {
        this(context, null);
    }

    public BottomNotDataView(Context context, @Nullable AttributeSet attrs) {
        super(context, attrs);
        View rootView = View.inflate(context, R.layout.load_more_view, null);
        addView(rootView);
        footStateDesc = rootView.findViewById(R.id.tv_foot_state_dec);
        LoadingIndicatorView loadingView = rootView.findViewById(R.id.loading);
        loadingView.setVisibility(GONE);
    }

    @Override
    public View getView() {
        return this;
    }

    public void setPullDownStr(String pullDownStr) {
        this.pullDownStr = pullDownStr;
    }

    public void setReleaseRefreshStr(String releaseRefreshStr) {
        this.releaseRefreshStr = releaseRefreshStr;
    }

    public void setRefreshingStr(String refreshingStr) {
        this.refreshingStr = refreshingStr;
    }

    private String pullDownStr = "上拉加载";
    private String releaseRefreshStr = "释放刷新";
    private String refreshingStr = "正在加载";

    @Override
    public void onPullingUp(float fraction, float maxBottomHeight, float bottomHeight) {
        footStateDesc.setText("没有数据");
    }

    @Override
    public void startAnim(float maxBottomHeight, float bottomHeight) {
        footStateDesc.setText("没有数据");

    }

    @Override
    public void onPullReleasing(float fraction, float maxBottomHeight, float bottomHeight) {
        footStateDesc.setText("没有数据");

    }

    @Override
    public void onFinish() {
        footStateDesc.setText("没有数据");

    }

    public void setTextColor(@ColorInt int color) {
        footStateDesc.setTextColor(color);
    }

    @Override
    public void reset() {
        footStateDesc.setText("没有数据");

    }
}
